-- GENERATED SPELL FOR [Kil'sorrow Spellbinder] --


function spell0_17146(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(34447,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17146', 626, 1)
end

function spell1_17146(pUnit, Event) --@Chains of Ice,n/a--
pUnit:FullCastSpellOnTarget(22744,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17146', 11000, 1)
end

function spell2_17146(pUnit, Event) --@Counterspell,n/a--
pUnit:FullCastSpellOnTarget(31999,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17146', 17000, 1)
end

function Sorts_17146(pUnit, Event)
local choix_sorts_17146 = math.random(0, 2)
if choix_sorts_17146 == 0 then
pUnit:RegisterEvent('spell0_17146', 1, 1)
end
if choix_sorts_17146 == 1 then
pUnit:RegisterEvent('spell1_17146', 1, 1)
end
if choix_sorts_17146 == 2 then
pUnit:RegisterEvent('spell2_17146', 1, 1)
end
end

function mob17146_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17146', math.random(1500, 3000), 1)
end

function mob17146_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17146_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17146_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17146, 1, 'mob17146_Action')
RegisterUnitEvent(17146, 2, 'mob17146_Leave')
RegisterUnitEvent(17146, 3, 'mob17146_Kill')
RegisterUnitEvent(17146, 4, 'mob17146_Die')
